package com.jiang.竞赛.Round76.B;

import java.util.Scanner;

/**
 * @author Jiang
 * @version 1.0
 * @date 2025/01/12 23:28
 */
public class Main {
    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);
        // 注意 hasNext 和 hasNextLine 的区别
        int len = in.nextInt();
        char[] s = in.next().toCharArray();
        int[] arr = new int[26];
        int cnt = 0;
        String res = "";
        for (int i = 0; i < len; i++) {
            if (cnt < ++arr[s[i] - 'a']) {
                cnt = arr[s[i] - 'a'];
                res = String.valueOf(s[i]);
            }
        }
        System.out.print(res);
    }
}
